﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IService.Model;
using IService.Business;

namespace IService
{
    public partial class ProductInfo : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected Dictionary<string, string> GetActivityContent
        {
            get
            {
                Dictionary<string, string> result = ContentDetail;
                if (result == null)
                {
                    result = new Dictionary<string, string>();
                    int newsid = int.Parse(ProductId);
                    Products product = DTVBusiness.ProductsManager.GetProductsById(newsid);
                    result.Add("Title", product.Title);
                    result.Add("Details", product.Details);
                    //result.Add("PublishMan", GetUserNameById(product.CreateUserId));
                    result.Add("CreateTime", product.CreateTime.ToString());
                    result.Add("Image", product.Image);
                    ContentDetail = result;
                }
                else
                {
                    //页面不存在
                }
                return result;
            }
        }

        protected Dictionary<string, string> ContentDetail
        {
            get
            {
                return (this.ViewState["contentDetail"] as Dictionary<string, string>);
            }
            set
            {
                this.ViewState["contentDetail"] = value;
            }
        }

        protected string ProductId
        {
            get
            {
                return base.Request["productId"];
            }
        }
    }
}